<template>
	<view class='tabbarBox'>
		<!-- <view class="fillBox"></view> -->
		<view class="footer">
			<view v-for="(item,index) in tabBarList" :key="index" class="item" @click="NavigatorPage(item,index)">
				<image class="image" :src="path == item.pagePath ? item.selectedIconPath : item.iconPath">
				</image>
				<view :style="path == item.pagePath ?  'color:#49A1FD;' : 'color:#BDBDBD;'">
					{{item.text}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "tabbar",
		props: {
			path: {
				type: String,
				default: '',
			},
			tabBarList: {
				type: Array,
				default: []
			}
		},

		methods: {
			NavigatorPage(item, index) {
				this.$emit('changTabBar', item.pagePath)
			},
		}
	}
</script>

<style lang="scss" scoped>
	.tabbarBox {
		width: 100%;

		.fillBox {
			padding-top: 120rpx;
		}

		.footer {
			// padding: 0 20rpx;
			position: fixed;
			bottom: 0;
			height: 108rpx;
			width: inherit;
			z-index: 9999;
			text-align: center;
			display: flex;
			align-items: center;
			justify-content: space-around;
			background: #ffffff;

			.item {
				font-size: 18rpx;
				width: 25%;

				.image {
					width: 50rpx;
					height: 50rpx;
					margin: 0 auto;
				}
			}
		}
	}
</style>